package com.mskj.p3.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mskj.p3.dao.HelpDao;
import com.mskj.p3.model.Help;
import com.mskj.p3.model.HelpSet;
import com.mskj.p3.model.Hobby;
import com.mskj.p3.model.PageBean;
import com.mskj.p3.model.User;
import com.mskj.p3.service.HelpService;

@Service
public class HelpServiceImp implements HelpService{

	@Autowired
	private HelpDao hd;
	
	@Override
	public boolean postHelp(User user, Help help,Hobby hobby) {
		help.setHid(hobby.getHid());
		help.setUid(user.getUid());
		return hd.postHelp(help);
	}

	@Override
	public boolean deleteHelp(User user, Help h) {
		return hd.deleteHelp(h, user);
	}

	@Override
	public List<HelpSet> queryHelpSet(User user, PageBean pb) {
		return hd.queryHelpSet(user,pb);
	}

	@Override
	public List<HelpSet> queryMyHelpSet(User user, PageBean pb) {
		return hd.queryMyHelpSet(user, pb);
	}

}
